package pkgs;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

import javax.imageio.ImageIO;

import com.jhlabs.image.GrayscaleFilter;

public class GrayDemo {
	
	public static void main(String[] args) throws FileNotFoundException, IOException {
		
		String imgfile="C:\\Users\\Administrator\\Desktop\\demoimg\\a.jpeg";
		BufferedImage gray_copy = new GrayscaleFilter().filter(ImageIO.read(new FileInputStream(imgfile))   , null);
		 
		String outimg = "C:\\Users\\Administrator\\Desktop\\demoimg\\a_gray.jpg";
		ImageIO.write(gray_copy, "jpg", new FileOutputStream(new File(outimg)));
	System.out.println("--f");
	}

}
